The present invention relates to an encoding method and apparatus, a decoding method and apparatus, a program, and a recording medium, in particular, to an encoding method and apparatus for encoding digital data of acoustic signals or sound signals with high efficiency to transmit thus encoded data or record thus encoded data to a recording medium, to a decoding method and apparatus for receiving or reproducing encoded data to decode thus received or reproduced encoded data, to a program for making a computer carry out the encoding processing and the decoding processing, and to a recording medium having recorded therein the program which can be read out by a computer.
This application claims priority of Japanese Patent Application No. 2002-132189, filed on May 7, 2002, the entirety of which is incorporated by reference herein.
Conventionally, as methods for encoding audio signals of sound signals, etc. with high efficiency, there are known non-blocking frequency band division systems, such as the band division encoding (subband coding), and blocking frequency band division systems, such as the conversion encoding.
In the non-blocking frequency band division systems, an audio signal on time base are divided into a plurality of frequency bands without blocking the signal, and thus divided signal is encoded. On the other hand, in the blocking frequency band division systems, a signal on time base is converted to a signal on frequency base (spectrum conversion), and thus converted signal is divided into a plurality of frequency bands. Then, coefficients obtained through the spectrum conversion are put together according to predetermined respective frequency bands, and thus divided signal is encoded in respective bands.
Furthermore, as a method to improve efficiency of encoding, there is suggested a high-efficient encoding method which jointly introduces the non-blocking frequency band division system and the blocking frequency band division system. Employing this method, after performing band division employing band division encoding, a signal divided into respective bands is converted to a signal on frequency base through spectrum conversion, and thus converted signal is encoded in the respective bands.
In performing frequency band division, the QMF (Quadrature Mirror Filter) may be used in many cases since signals can be processed simply and aliasing distortions can be removed. Details of frequency band division by the QMF are written in “1976R. E. Crochiere, Digital coding of speech in subbands, Bell Syst. Tech.J.Vol.55, No.8 1976”.
Furthermore, as a method to perform band division, there is known the PQF (Polyphase Quadrature Filter) which is a filter division method with equalized bandwidths. Details of the PQF are written in “ICASSP 83 BOSTON, Polyphase Quadrature Filters—A new subband coding technique, Joseph H. Rothweiler”.
On the other hand, as above-described spectrum conversion, for example, an input audio signal is blocked using a frame of predetermined unit time, and the signal on time base is converted to a signal on frequency base by undergoing the DFT (Discrete Fourier Transformation), DCT (Discrete Cosine Transformation), MDCT (Modified Discrete Cosine Transformation) in respective blocks.
Details of the MDCT are written in “ICASSP 1987, Subband/Transform Coding Using Filter Bank Designs Based on Time Domain Aliasing Cancellation, J. P. Prince, A. B. Bradley, Univ. of Surrey Royal Melbourne Inst. of Tech.”
By quantizing a signal divided into respective bands which is obtained through the filter and spectrum conversion, bands which raise quantization noise can be controlled, which enables high-efficient encoding in auditory sense by utilizing property of masking effect, etc. Furthermore, prior to quantization, signal components of respective bands are normalized by the maximum of absolute values of signal components of each band, which enables more high-efficient encoding.
Bandwidths of respective frequency bands in performing band division are determined in view of human auditory property. That is, in general, an audio signal may be divided into a plurality of bands (for example, 32 bands) under critical bands in which higher bands are of broader bandwidth.
In encoding data in respective bands, bit allocation is performed to allocate predetermined bits or adaptable bits to respective bands. That is, in encoding coefficient data, obtained through the MDCT processing, by employing bit allocation, the numbers of bits are adaptably allocated to MDCT coefficient data of respective bands that are obtained by performing the MDCT processing for a signal blocked into respective blocks.
As bit allocation methods, there are known a method of performing bit allocation based on signal amount of respective bands (properly referred to as a first bit allocation method, hereinafter), and a method of performing bit allocation fixedly, in which signal-to-noise ratios necessary for respective bands are obtained by utilizing auditory masking (properly referred to as a second bit allocation method, hereinafter).
Details of the first bit allocation method are written in “Adaptive Transform Coding of Speech Signals, R. Zelinski and P. Noll, IEEE Transactions of Accoustics, Speech and Signal Processing, vol.ASSP-25, No.4, August 1977”.
Details of the second bit allocation method are written in “ICASSP 1980, The critical band coder digital encoding of the perceptual requirements of the auditory system, M. A. Kransner MIT”.
Employing the first bit allocation method, quantization noise spectrums are planarized, minimizing noise energy. However, since masking effect is not utilized in auditory sense, actual auditory noise level is not optimized. On the other hand, employing the second bit allocation method, in case energy is concentrated on a specific frequency, for example, even though a sinusoidal wave is input, since bit allocation is performed fixedly, desirable property value cannot be obtained.
So, there is suggested a high-efficient encoding apparatus which divides entire bits, which are to be used in bit allocation, into bits for fixed bit allocation patterns which are determined in advance for respective small blocks and bits for bit allocation which depend on signal amount of respective blocks, and causes the division ration to depend on a signal related with an input signal. That is, for example, when spectrums of a signal are smooth, division proportion for the fixed bit allocation patterns is enhanced.
Employing this method, in case energy is concentrated on a specific spectrum when inputting a sinusoidal wave, many bits are allocated to a block including the spectrum, which can improve the whole signal-to-noise ratio significantly. In general, since human auditory is extremely sensitive to a signal having a steep spectrum component, above-described improvement of signal-to-noise ratio not only improves measurement numerical value but also improves quality of sound in auditory sense effectively.
As methods of bit allocation, there are suggested many other methods other than above-described methods, and models concerning auditory are becoming refined. Improvement in operational capability of an encoding apparatus enables high-efficient encoding from an auditory point of view.
In case of employing the DFT or the DCT as a method to convert a waveform signal to spectrums, when converting the signal using time blocks composed of M sets of samples, M sets of independent real number data can be obtained. Generally, in order to reduce connection distortions between time blocks (frames), each block is overlapped with both neighbouring blocks by predetermined M1 sets of samples respectively. Thus, when employing an encoding method utilizing the DFT or the DCT, M sets of real number data are quantized to be encoded for (M-M1) sets of samples on the average.
In case of employing the MDCT as a method to convert a signal on time base to spectrums, M sets of independent real number data can be obtained from 2M sets of samples with each block overlapped with both neighbouring blocks by M sets of samples respectively. Thus, in this case, M sets of real number data are quantized to be encoded for M sets of samples on the average. Then, a decoding apparatus regenerate a waveform signal from codes obtained in above-described method that utilizes the MDCT by adding waveform components obtained from respective blocks through inverse conversion with the respective waveform components interfering with each other.
In general, by making time blocks (frames) for conversion longer, frequency resolution of spectrums is enhanced and energy is concentrated on a specific spectrum component. In case of using the MDCT, in which a signal is converted using long blocks with each block overlapped with both neighbouring blocks by half and the number of obtained spectrums does not increase from the number of original time samples, it becomes possible to realize high-efficient encoding as compared with the case using the DFT or the DCT. Furthermore, by making adjacent blocks have properly long overlaps, distortions between blocks of a waveform signal can be reduced.
In generating an actual code sequence, firstly, quantization accuracy information indicative of a quantization step used to perform quantization and normalization coefficient information indicative of a coefficient used to normalize respective signal components are encoded with predetermined number of bits for respective bands in which normalization and quantization are to be performed. Then normalized and quantized spectrums are encoded.
There is written a high-efficient encoding method in “IDO/IEC 11172-3:1993(E), 1993”, in which the numbers of bits indicative of quantization accuracy information are set to be different from band to band. According to the method, it is prescribed that higher bands are small in the number of bits indicative of quantization accuracy information.
In encoding spectrums, there is known the variable codeword length coding method such as the Huffman coding. Details of the Huffman coding are written in “David A. Huffman, “A Method for the Construction of Minimum—Redundancy Codes”, Proceedings of the I.R.E., pp1098-1101, September 1952”.
In general, it becomes possible to improve compression efficiency of spectrums when plural kinds of code tables are prepared and proper tables are employed by exchanging them, as compared with the case employing a single Huffman code table alone, since optimum code tables can be used for various input signals.
However, in case of encoding code table indexes indicative of used code tables in respective quantization units, the number of encoding bits of the indexes is undesirably increased since the number of code tables is increased.
For example, it is assumed that the number of quantization units is 16, and indexes are encoded in respective quantization units. In case the number of code tables is 4 (2 bits), the number of encoding bits of the indexes is 32 (=2 bits×16 units). On the other hand, in case the number of code tables is 8 (3 bits), the number of encoding bits of the indexes is undesirably increased to be 48 (=3 bits×16 units). Thus, in case the total number of bits is fixed, the number of bits to encode spectrum information is decreased by 16 (48 bits−32 bits). There is raised no problem in case compression ratio is enhanced by more than a value corresponding to 16 bits due to increase of the number of code tables, while in case compression ratio is not enhanced, the whole compression ratio is undesirably lowered.
That is, in case the number of code tables is increased, compression ratio of spectrum information itself is enhanced, while the whole compression ratio is not necessarily enhanced since the number of encoding bits of indexes of code tables is increased.